/**
 * Treatment record class
 */
package com.data.documents;

import java.util.Calendar;

import com.users.User;

/**
 * Class TreatRecords. This implements treatment records.
 * 
 * @author Elizabeth
 * @version 1.1
 */
public class TreatmentRecord extends UserDocument {

	/**
	 * date variable
	 */
	private long dateTime;

	/**
	 * attendingDoctor variable
	 */
	private User attendingDoctor;

	/**
	 * attending nurse variable
	 */
	private User attendingNurse;

	/**
	 * blood pressure variable
	 */
	private double bloodPressure;

	/**
	 * pulse variable
	 */
	private double pulse;

	/**
	 * temperature variable
	 */
	private double temperature;

	/**
	 * height variable
	 */
	private double height;

	/**
	 * weight variable
	 */
	private double weight;

	/**
	 * chief complaint variable
	 */
	private String chiefComplaint;

	/**
	 * diagnosis variable
	 */
	private String diagnosis;

	/**
	 * Doctors Order variable
	 */
	private DoctorsOrder doctorsOrder;
	
	private Invoice invoice;

	/**
	 * Constructor for treatment record class.
	 * 
	 * @param docId
	 * @param date
	 * @param time
	 * @param attendingDoctor
	 * @param attendingNurse
	 * @param bloodPressure
	 * @param pulse
	 * @param temperature
	 * @param height
	 * @param weight
	 * @param chiefComplaint
	 * @param diagnosis
	 * @param doctorsOrder
	 */
	public TreatmentRecord(String docId, long dateTime,
			User attendingDoctor, User attendingNurse, double bloodPressure,
			double pulse, double temperature, double height, double weight,
			String chiefComplaint, String diagnosis, DoctorsOrder doctorsOrder, Invoice invoice) {
		super(docId, "treatment_records");
		this.dateTime = dateTime;
		this.attendingDoctor = attendingDoctor;
		this.attendingNurse = attendingNurse;
		this.bloodPressure = bloodPressure;
		this.pulse = pulse;
		this.temperature = temperature;
		this.height = height;
		this.weight = weight;
		this.chiefComplaint = chiefComplaint;
		this.diagnosis = diagnosis;
		this.doctorsOrder = doctorsOrder;
		this.invoice = invoice;
	}
	
	public TreatmentRecord(String docId, DoctorsOrder docOrder, Invoice inv){
		this(docId, 0, null, null, 0, 0, 0, 0, 0, "", "", docOrder, inv);
	}
	 

	/**
	 * @return the time
	 */
	public long getDateTime() {
		return dateTime;
	}

	/**
	 * @param time
	 *            the time to set
	 */
	public void setDateTime(long dateTime) {
		this.dateTime = dateTime;
	}

	/**
	 * @return the attendingDoctor
	 */
	public User getAttendingDoctor() {
		return attendingDoctor;
	}

	/**
	 * @param attendingDoctor
	 *            the attendingDoctor to set
	 */
	public void setAttendingDoctor(User attendingDoctor) {
		this.attendingDoctor = attendingDoctor;
	}

	/**
	 * @return the attendingNurse
	 */
	public User getAttendingNurse() {
		return attendingNurse;
	}

	/**
	 * @param attendingNurse
	 *            the attendingNurse to set
	 */
	public void setAttendingNurse(User attendingNurse) {
		this.attendingNurse = attendingNurse;
	}

	/**
	 * @return the bloodPressure
	 */
	public double getBloodPressure() {
		return bloodPressure;
	}

	/**
	 * @param bloodPressure
	 *            the bloodPressure to set
	 */
	public void setBloodPressure(double bloodPressure) {
		this.bloodPressure = bloodPressure;
	}

	/**
	 * @return the pulse
	 */
	public double getPulse() {
		return pulse;
	}

	/**
	 * @param pulse
	 *            the pulse to set
	 */
	public void setPulse(double pulse) {
		this.pulse = pulse;
	}

	/**
	 * @return the temperature
	 */
	public double getTemperature() {
		return temperature;
	}

	/**
	 * @param temperature
	 *            the temperature to set
	 */
	public void setTemperature(double temperature) {
		this.temperature = temperature;
	}

	/**
	 * @return the height
	 */
	public double getHeight() {
		return height;
	}

	/**
	 * @param height
	 *            the height to set
	 */
	public void setHeight(double height) {
		this.height = height;
	}

	/**
	 * @return the weight
	 */
	public double getWeight() {
		return weight;
	}

	/**
	 * @param weight
	 *            the weight to set
	 */
	public void setWeight(double weight) {
		this.weight = weight;
	}

	/**
	 * @return the chiefComplaint
	 */
	public String getChiefComplaint() {
		return chiefComplaint;
	}

	/**
	 * @param chiefComplaint
	 *            the chiefComplaint to set
	 */
	public void setChiefComplaint(String chiefComplaint) {
		this.chiefComplaint = chiefComplaint;
	}

	/**
	 * @return the diagnosis
	 */
	public String getDiagnosis() {
		return diagnosis;
	}

	/**
	 * @param diagnosis
	 *            the diagnosis to set
	 */
	public void setDiagnosis(String diagnosis) {
		this.diagnosis = diagnosis;
	}

	/**
	 * @return the doctorsOrder
	 */
	public DoctorsOrder getDoctorsOrder() {
		return doctorsOrder;
	}

	/**
	 * @param doctorsOrder
	 *            the doctorsOrder to set
	 */
	public void setDoctorsOrder(DoctorsOrder doctorsOrder) {
		this.doctorsOrder = doctorsOrder;
	}
	
	public Invoice getInvoice(){
		return invoice;
	}
	
	public void setInvoice(Invoice invoice){
		this.invoice = invoice;
	}
	
	public String[] getDataAsStrings(){
		Calendar c = Calendar.getInstance();
		c.setTimeInMillis(dateTime);
		String[] sample = {
				"Treatment Record",
				(c.get(Calendar.MONTH)+1) + "/" + c.get(Calendar.DAY_OF_MONTH)
						+ "/" + c.get(Calendar.YEAR), "With " + attendingDoctor.getName()};
		return sample;
	}
}